package com.vf.admin.miaodong.entity;

import com.vf.admin.common.db.annotation.Column;
import com.vf.admin.common.db.annotation.Table;
import lombok.Data;

import java.io.Serializable;

@Data
@Table(name = "sys_area")
public class SsArea implements Serializable {

    private static final long serialVersionUID = 1L;

    @Column(length = 10, name = "id", index = true)
    private Integer id;

    @Column(name = "parent_id")
    private Integer parentId;

    @Column(name = "code")
    private String code;

    @Column(name = "name")
    private String name;

    public static SsArea buildArea(SsCities param) {
        SsArea area = new SsArea();
        area.setId(param.getCityid());
        area.setParentId(param.getProvinceid());
        area.setCode(param.getCityid().toString());
        area.setName(param.getCity());
        return area;
    }
}
